<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edit agent</title>
</head>
<body>
	
	<form:form action="${pageContext.request.contextPath}/agents/edit" modelAttribute="editedAgent" method="POST">
		<form:hidden path="id"/>
		<br>
		<form:label path="firstname">Firstname</form:label>
		<form:input type="text" placeholder="Firstname" path="firstname" />
		<form:errors path="firstname"></form:errors>
		<br>
		<form:label path="lastname">Lastname</form:label>
		<form:input type="text" placeholder="Lastname" path="lastname" />
		<form:errors path="lastname"></form:errors>
		<br>
		<form:label path="email">Email</form:label>
		<form:input placeholder="Email" path="email" type="email" required="true" />
		<form:errors path="email"></form:errors>
		<br>
		<form:label path="birthDate">Birth date</form:label>
		<form:input type="date" placeholder="Birth date" path="birthDate" required="true" />
		<form:errors path="birthDate"></form:errors>
		<br>
		<form:label path="gender">Gender</form:label>
		<form:select path="gender" items="${ genders }"></form:select>
		<form:errors path="gender"></form:errors> 
		<br>
		<input type="reset" value="Reset">
		<input type="submit" value="Edit">
	</form:form>
	
	<br>
	<a href="${pageContext.request.contextPath}/agents/edit-password">Edit password</a>

</body>
</html>